<div class='rosterContainer'>
	
	<ul class='rosterNav'>
		<li><a href='#' class="roster active">Roster courant</a></li>
		<li><a href='#' class="roster-casual">Night raiders</a></li>
		<li><a href='#' class="roster-staff">Équipe Discovery</a></li>
	</ul>
	
	<div class='rosterContent' id='roster'>
		<h2>Roster courant</h2>
<?
	foreach($data_classes as $id=>$data_classe){
		echo "<div class='roster_liste_classe'><div class='roster_liste_classe_title roster_liste_classe_".$id."'>".$data_classe[0]."</div>\n";
		$res=$sql->request("SELECT * FROM `".CFG_MYSQL_PREFIX."player` WHERE `classe`=".$id." AND `casual`=0 ORDER BY `grade`, `nom`");
		foreach($res as $var){
			$player=new player($var);
			$datas=$player->get_datas();
			write_ctn("roster",$datas);
		}
		echo "</div>";
	}	
?>
	</div>
	<div class='rosterContent' id='roster-casual'>
		<h2>Night raiders</h2>
<?
	foreach($data_classes as $id=>$data_classe){
		echo "<div class='roster_liste_classe'><div class='roster_liste_classe_title roster_liste_classe_".$id."'>".$data_classe[0]."</div>\n";
		$res=$sql->request("SELECT * FROM `".CFG_MYSQL_PREFIX."player` WHERE `classe`=".$id." AND `casual`=1 ORDER BY `grade`, `nom`");
		foreach($res as $var){
			$player=new player($var);
			$datas=$player->get_datas();
			write_ctn("roster",$datas);
		}
		echo "</div>\n";
	}
?>
	</div>
	<div class='rosterContent' id='roster-staff'>
		<h2>Équipe Discovery</h2>
<?
	foreach($data_staffs as $id=>$data_staff){
		echo "<div class='roster_liste_classe' id='".$data_staff['title']."'><div class='roster_liste_classe_title roster_liste_classe_".$id."'>".ucfirst($data_staff['title'])."</div>\n";
		$res=$sql->request("SELECT a.* FROM ".CFG_MYSQL_PREFIX."player AS a LEFT JOIN ibf_members AS b ON a.idUser = b.id WHERE b.mgroup IN (".$data_staff['mgroup'].") GROUP BY a.nom ORDER BY a.nom");
		foreach($res as $var){
			$player=new player($var);
			$datas=$player->get_datas();		
			$resto=$sql->request("SELECT g.`g_title`, g.`g_id` FROM `ibf_groups` AS g LEFT JOIN `ibf_members` AS m ON g.`g_id` = m.`mgroup` WHERE m.`id` = '".$var->idUser."' GROUP BY `g_id` LIMIT 1");
			$grdstr = utf8_encode($resto[0]->g_title);
			$datas['GRADE_STR'] = str_replace("[Staff] ", "", $grdstr);
			$datas['GRADE_STR'] = str_replace("[", "", $datas['GRADE_STR']);
			$datas['GRADE_STR'] = str_replace("]", "", $datas['GRADE_STR']);
			write_ctn("roster",$datas);
		}
	/* TODO: Find unrostered staff members, and show them with a default avatar. */
		echo "</div>\n";
	}
?>
	</div>
</div>